package app.domain.util;

public class StockProtocol {
	
	public final static String NEW_ORDER_MATCHER = "^sequenceId=([0-9]*);referenceId=([0-9]*);msgType=newOrder;ticket=([A-Z]{3});type=([A-Z]);side=([A-Z]);amount=([-+]?[0-9]*);price=([-+]?[0-9]*\\.?[0-9]*[eE]?[0-9]*)$";
	public final static String CANCEL_ORDER_MATCHER = "^sequenceId=([0-9]*);referenceId=([0-9]*);msgType=cancelOrder$";
	public final static String LOGIN_MATCHER = "^sequenceId=([0-9]+);login=(\\w+)$";
	public final static String HEARTBEAT_MATCHER = "^sequenceId=([0-9]+);a$";
	public final static String FAREWELL_MATCHER = "^sequenceId=([0-9]+);bye$";

	public final static String INVALID = "msgType=invalidMsg";
	public final static String LOGIN_OK = "msgType=loginClientOk";
	public final static String LOGIN_INVALID_ERROR = "msgType=loginErrorInvalidName";
	public final static String LOGIN_DUPLICATE_ERROR = "msgType=loginErrorDuplicateName";
	public final static String NEW_ORDER_INVALID_FIELDS = "msgType=newOrderError;invalidFields: ";
	public final static String CANCEL_ORDER_INVALID_FIELDS = "msgType=cancelOrderError;invalidFields: ";
	public final static String HEARTBEAT = "a";
	public final static String FAREWELL = "bye";
	public final static String FULL_MATCH = "F";
	public final static String PART_MATCH = "P";
	
	public final static String REFERENCE = "referenceId;";
	public final static String TYPE = "type;";
	public final static String TICKET = "ticket;";
	public final static String SIDE = "side;";
	public final static String AMOUNT = "amount;";
	public final static String PRICE = "price;";
	public final static String CREATING_ORDER = "creating order...";
	public final static String CANCELING_ORDER = "canceling order...";
	
	public final static int HEARTGAP = 10 * 1000;
	public final static int WAITGAP = 15 * 1000;
	
}
